import React, { Component } from 'react'
import { BrowserRouter, Route, Switch, Redirect } from "react-router-dom";
import Login from './pages/Login'
import UserCenter from './pages/Layout/UserCenter'
import ProblemPool from './pages/Layout/ProblemPool'
import Layout from './pages/Layout'

export default class App extends Component {
  render() {
    return (
      <div style={{ width:'100%',background: '#fff', overflow:'hidden',minHeight:'100vh'}}>
        <BrowserRouter>
          <Switch>
            <Route path='/login' component={Login}  />
            <Route path='/problempool' render={routeProps=><Layout {...routeProps}><ProblemPool {...routeProps} ></ProblemPool></Layout>}  />
            <Route path='/usercenter' render={routeProps=><Layout {...routeProps}><UserCenter {...routeProps} ></UserCenter></Layout>}  />
            <Redirect to='/login' />
          </Switch>
        </BrowserRouter>
      </div>
    )
  }
}

